package com.tang.controller.indexController;

import com.tang.entity.Blog;
import com.tang.service.BlogService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;

/**
 * @author tmh
 * @date 2022/12/4 16:32
 * @description
 */
@Controller
public class index {
    @Resource
    private BlogService blogService;
    @GetMapping("/index")
    public String index(Model model){
        model.addAttribute("msg","<br>tmh</br>");
        Blog blog=blogService.selectById(1);
        model.addAttribute("blog1",blog);
        return "index";
    }
}
